3.210 \(\int \cot ^6(e+f x) (a+b \tan ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=68 \[ -\frac{a^2 \cot ^5(e+f x)}{5 f}+\frac{a (a-2 b) \cot ^3(e+f x)}{3 f}-\frac{(a-b)^2 \cot (e+f x)}{f}-x (a-b)^2 \]

[Out]

-((a - b)^2*x) - ((a - b)^2*Cot[e + f*x])/f + (a*(a - 2*b)*Cot[e + f*x]^3)/(3*f) - (a^2*Cot[e + f*x]^5)/(5*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0769123, antiderivative size = 68, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {3670, 461, 203} \[ -\frac{a^2 \cot ^5(e+f x)}{5 f}+\frac{a (a-2 b) \cot ^3(e+f x)}{3 f}-\frac{(a-b)^2 \cot (e+f x)}{f}-x (a-b)^2 \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]^6*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

-((a - b)^2*x) - ((a - b)^2*Cot[e + f*x])/f + (a*(a - 2*b)*Cot[e + f*x]^3)/(3*f) - (a^2*Cot[e + f*x]^5)/(5*f)

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rule 461

Int[(((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_))/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Int[ExpandIntegr
and[((e*x)^m*(a + b*x^n)^p)/(c + d*x^n), x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && IGtQ[n
, 0] && IGtQ[p, 0] && (IntegerQ[m] || IGtQ[2*(m + 1), 0] ||  !RationalQ[m])

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \cot ^6(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a+b x^2\right )^2}{x^6 \left (1+x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \left (\frac{a^2}{x^6}-\frac{a (a-2 b)}{x^4}+\frac{(a-b)^2}{x^2}-\frac{(a-b)^2}{1+x^2}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac{(a-b)^2 \cot (e+f x)}{f}+\frac{a (a-2 b) \cot ^3(e+f x)}{3 f}-\frac{a^2 \cot ^5(e+f x)}{5 f}-\frac{(a-b)^2 \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-(a-b)^2 x-\frac{(a-b)^2 \cot (e+f x)}{f}+\frac{a (a-2 b) \cot ^3(e+f x)}{3 f}-\frac{a^2 \cot ^5(e+f x)}{5 f}\\ \end{align*}

Mathematica [C]  time = 0.102449, size = 104, normalized size = 1.53 \[ -\frac{a^2 \cot ^5(e+f x) \text{Hypergeometric2F1}\left (-\frac{5}{2},1,-\frac{3}{2},-\tan ^2(e+f x)\right )}{5 f}-\frac{2 a b \cot ^3(e+f x) \text{Hypergeometric2F1}\left (-\frac{3}{2},1,-\frac{1}{2},-\tan ^2(e+f x)\right )}{3 f}-\frac{b^2 \cot (e+f x) \text{Hypergeometric2F1}\left (-\frac{1}{2},1,\frac{1}{2},-\tan ^2(e+f x)\right )}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]^6*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

-(a^2*Cot[e + f*x]^5*Hypergeometric2F1[-5/2, 1, -3/2, -Tan[e + f*x]^2])/(5*f) - (2*a*b*Cot[e + f*x]^3*Hypergeo
metric2F1[-3/2, 1, -1/2, -Tan[e + f*x]^2])/(3*f) - (b^2*Cot[e + f*x]*Hypergeometric2F1[-1/2, 1, 1/2, -Tan[e +
f*x]^2])/f

________________________________________________________________________________________

Maple [A]  time = 0.053, size = 91, normalized size = 1.3 \begin{align*}{\frac{1}{f} \left ({b}^{2} \left ( -\cot \left ( fx+e \right ) -fx-e \right ) +2\,ab \left ( -1/3\, \left ( \cot \left ( fx+e \right ) \right ) ^{3}+\cot \left ( fx+e \right ) +fx+e \right ) +{a}^{2} \left ( -{\frac{ \left ( \cot \left ( fx+e \right ) \right ) ^{5}}{5}}+{\frac{ \left ( \cot \left ( fx+e \right ) \right ) ^{3}}{3}}-\cot \left ( fx+e \right ) -fx-e \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)^6*(a+b*tan(f*x+e)^2)^2,x)

[Out]

1/f*(b^2*(-cot(f*x+e)-f*x-e)+2*a*b*(-1/3*cot(f*x+e)^3+cot(f*x+e)+f*x+e)+a^2*(-1/5*cot(f*x+e)^5+1/3*cot(f*x+e)^
3-cot(f*x+e)-f*x-e))

________________________________________________________________________________________

Maxima [A]  time = 1.62399, size = 105, normalized size = 1.54 \begin{align*} -\frac{15 \,{\left (a^{2} - 2 \, a b + b^{2}\right )}{\left (f x + e\right )} + \frac{15 \,{\left (a^{2} - 2 \, a b + b^{2}\right )} \tan \left (f x + e\right )^{4} - 5 \,{\left (a^{2} - 2 \, a b\right )} \tan \left (f x + e\right )^{2} + 3 \, a^{2}}{\tan \left (f x + e\right )^{5}}}{15 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^6*(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

-1/15*(15*(a^2 - 2*a*b + b^2)*(f*x + e) + (15*(a^2 - 2*a*b + b^2)*tan(f*x + e)^4 - 5*(a^2 - 2*a*b)*tan(f*x + e
)^2 + 3*a^2)/tan(f*x + e)^5)/f

________________________________________________________________________________________

Fricas [A]  time = 1.09477, size = 204, normalized size = 3. \begin{align*} -\frac{15 \,{\left (a^{2} - 2 \, a b + b^{2}\right )} f x \tan \left (f x + e\right )^{5} + 15 \,{\left (a^{2} - 2 \, a b + b^{2}\right )} \tan \left (f x + e\right )^{4} - 5 \,{\left (a^{2} - 2 \, a b\right )} \tan \left (f x + e\right )^{2} + 3 \, a^{2}}{15 \, f \tan \left (f x + e\right )^{5}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^6*(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

-1/15*(15*(a^2 - 2*a*b + b^2)*f*x*tan(f*x + e)^5 + 15*(a^2 - 2*a*b + b^2)*tan(f*x + e)^4 - 5*(a^2 - 2*a*b)*tan
(f*x + e)^2 + 3*a^2)/(f*tan(f*x + e)^5)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)**6*(a+b*tan(f*x+e)**2)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.81102, size = 300, normalized size = 4.41 \begin{align*} \frac{3 \, a^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{5} - 35 \, a^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} + 40 \, a b \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} + 330 \, a^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 600 \, a b \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 240 \, b^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 480 \,{\left (a^{2} - 2 \, a b + b^{2}\right )}{\left (f x + e\right )} - \frac{330 \, a^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{4} - 600 \, a b \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{4} + 240 \, b^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{4} - 35 \, a^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 40 \, a b \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 3 \, a^{2}}{\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{5}}}{480 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^6*(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/480*(3*a^2*tan(1/2*f*x + 1/2*e)^5 - 35*a^2*tan(1/2*f*x + 1/2*e)^3 + 40*a*b*tan(1/2*f*x + 1/2*e)^3 + 330*a^2*
tan(1/2*f*x + 1/2*e) - 600*a*b*tan(1/2*f*x + 1/2*e) + 240*b^2*tan(1/2*f*x + 1/2*e) - 480*(a^2 - 2*a*b + b^2)*(
f*x + e) - (330*a^2*tan(1/2*f*x + 1/2*e)^4 - 600*a*b*tan(1/2*f*x + 1/2*e)^4 + 240*b^2*tan(1/2*f*x + 1/2*e)^4 -
 35*a^2*tan(1/2*f*x + 1/2*e)^2 + 40*a*b*tan(1/2*f*x + 1/2*e)^2 + 3*a^2)/tan(1/2*f*x + 1/2*e)^5)/f